#ifndef __CUST_UART_H__
#define __CUST_UART_H__
enum
{
	UART_ID1,
	UART_ID2,
	UART_ID3,
	UART_MAX = UART_ID2 + 1,
	UART_RX_IRQ = 0,
	UART_TX_DONE_IRQ,
	UART_TX_ERROR_IRQ,
	UART_RX_DONE_IRQ,
	UART_RX_ERROR_IRQ,
};

typedef struct
{
	MyCBFun_t UartCB;
	uint32_t BR;
	uint8_t *TxBuf;
	uint16_t TxLen;
	uint16_t FinishLen;
	uint8_t TxBusy;
	uint8_t TxComplete;
}UART_CtrlStruct;
void Uart_GPIOInit(uint8_t UartID);
void Uart_Open(uint8_t UartID);
void Uart_Close(uint8_t UartID);
void Uart_Init(uint8_t UartID, uint32_t BR, MyCBFun_t CB);
void Uart_SetCallback(uint8_t UartID, MyCBFun_t CB);
uint32_t Uart_Tx(uint8_t UartID, void *Src, uint16_t Len, uint8_t IsDMAMode);
void Uart_EnableRx(uint8_t UartID);
uint32_t Uart_DMARx(uint8_t UartID, void *Data, uint16_t Len);
uint16_t Uart_Rx(uint8_t UartID);
uint8_t Uart_CheckBusy(uint8_t UartID);
#endif
